package com.hd.trans;

import android.content.Context;
import android.content.Intent;

import androidx.annotation.NonNull;

import com.hd.trans.limit4Use.LimitUseListener;
import com.hd.trans.network.bean.UserInfoBean;
import com.hd.trans.ui.activity.AiChatActivity;
import com.hd.trans.ui.activity.FavoritesActivity;
import com.hd.trans.ui.activity.FavoritesManagerActivity;
import com.hd.trans.ui.activity.FilesHomeActivity;
import com.hd.trans.ui.activity.FullScreenActivity;
import com.hd.trans.ui.activity.OfflineHomeActivity;
import com.hd.trans.ui.activity.PictureTransHistoryActivity;
import com.hd.trans.ui.activity.TextHistoryActivity;
import com.hd.trans.ui.activity.VoiceFirstAidKitActivity;
import com.hd.trans.ui.activity.VoicePlaySettingActivity;
import com.hd.trans.ui.activity.WebHomeActivity;
import com.hd.trans.ui.activity.WordTranslateActivity;
import com.hd.trans.ui.activity.customize.PictureTranslateActivity;
import com.hd.trans.ui.activity.customize.SimulTranslateActivity;
import com.hd.trans.ui.activity.customize.TextTranslateActivity;
import com.hd.trans.ui.activity.customize.VoiceTranslateActivity;
import com.hd.trans.utils.TrackerForTrans;

public class TranslationUI {
    private TranslationUI() {}

    /**
     * 打开文本翻译界面
     */
    public static void openTextTransActivity(Context context) {
        //TextHomeActivity.open(context, TranslationInterior.getLimitUseListener());
        TextTranslateActivity.open(context, TranslationInterior.getLimitUseListener());
    }
    public static void openTextTransActivity(Context context, long recordId) {
        //TextHomeActivity.open(context, TranslationInterior.getLimitUseListener());
        TextTranslateActivity.open(context, recordId, TranslationInterior.getLimitUseListener());
    }

    /**
     * 打开语音翻译界面
     */
    public static void openVoiceTransActivity(Context context) {
        //VoiceHomeActivity.open(context, TranslationInterior.getLimitUseListener());
        VoiceTranslateActivity.open(context, TranslationInterior.getLimitUseListener());
    }

    /**
     * 打开同声传译界面
     */
    public static void openSimultaneousTransActivity(Context context) {
        //SimulHomeActivity2.open(context, TranslationInterior.getLimitUseListener());
        SimulTranslateActivity.open(context, TranslationInterior.getLimitUseListener());
    }

    /**
     * 打开拍照翻译（图片翻译）界面
     */
    public static void openCameraTransActivity(Context context) {
        PictureTranslateActivity.open(context, TranslationInterior.getLimitUseListener());
    }

    /**
     * 打开网页翻译界面
     */
    public static void openWebTransActivity(Context context) {
        WebHomeActivity.open(context, TranslationInterior.getLimitUseListener(), null);
    }

    /**
     * 打开取词翻译界面
     */
    public static void openWordTransActivity(Context context) {
        WordTranslateActivity.open(context, TranslationInterior.getLimitUseListener());
    }

    /**
     * 打开离线翻译包下载界面
     */
    public static void openOfflinePkgDownloadActivity(Context context) {
        OfflineHomeActivity.open(context);
    }

    /**
     * 打开出国急救包界面
     */
    public static void openVoiceFirstAidKitActivity(Context context) {
        VoiceFirstAidKitActivity.open(context, TranslationInterior.getLimitUseListener());
    }

    /**
     * 打开文本翻译历史记录界面
     */
    public static void openTextHistoryActivity(Context context) {
        TextHistoryActivity.open(context);
    }

    /**
     * 打开文本翻译记录收藏界面
     */
    public static void openFavoritesActivity(Context context) {
        FavoritesActivity.open(context);
    }

    /**
     * 打开文本翻译记录收藏界面
     */
    public static void openFavoritesManagerActivity(Context context) {
        FavoritesManagerActivity.open(context);
    }

    /**
     * 打开声音设置界面
     */
    public static void openVoiceSettingActivity(Context context, boolean showTopTitle) {
        VoicePlaySettingActivity.open(context, showTopTitle);
    }

    /**
     * 打开AI对话界面
     */
    public static void openAiChatActivity(Context context, @NonNull UserInfoBean bean) {
        AiChatActivity.open(context, TranslationInterior.getLimitUseListener(), bean, 0);
    }

    /**
     * 打开拍照翻译（图片翻译）历史记录界面
     */
    public static void openCameraTransHistoryActivity(Context context, LimitUseListener listener) {
        PictureTransHistoryActivity.open(context, listener);
    }

    /**
     * 打开文档翻译界面
     */
    public static void openDocumentTransActivity(Context context) {
        FilesHomeActivity.openDocument(context, TranslationInterior.getLimitUseListener());
    }

    /**
     * 打开视频翻译界面
     */
    public static void openVideoTransActivity(Context context) {
        FilesHomeActivity.openVideo(context, TranslationInterior.getLimitUseListener());
    }

    /**
     * 打开音频翻译界面
     */
    public static void openAudioTransActivity(Context context) {
        FilesHomeActivity.openAudio(context, TranslationInterior.getLimitUseListener());
    }

    /**
     * 打开文件翻译历史记录界面
     */
    public static void openFileTransHistoryActivity(Context context) {
        //
    }

    /**
     * 打开全屏翻译界面
     */
    public static void openFullScreenTransActivity(Context context, String text) {
        //全屏显示
        TranslationInterior.getTrackerListener().click(TrackerForTrans.YYFY,TrackerForTrans.QuanPing);
        Intent intent = new Intent(context, FullScreenActivity.class);
        intent.putExtra("content", text);
        context.startActivity(intent);
    }
}
